<?php

namespace bc\model\zsmm;

use bc\ar\AppActiveRecord;

class RegisterModel extends AppActiveRecord
{
	public static function tableName()
	{
		return 'zsmm_user';
	}
	
	public function getStatistics($start_time, $end_time)
	{
		$start_time_str = $start_time . ' 00:00:00';
		$end_time_str = $end_time . ' 23:59:59';
		$sql = "select count(1) as total, DATE_FORMAT(createdTime, '%Y-%m-%d') as `date` from zsmm_user where createdTime >= '{$start_time_str}' and createdTime <= '{$end_time_str}' group by `date` order by `date` desc";
		return $this->getDb()->createCommand($sql)->queryAll();
	}
}

